<template>
  <div>
    <el-card>
      <el-tabs v-model="activeName">
        <el-tab-pane label="基本信息" name="first">
          <el-form :inline="true" ref="firstForm" :model="form" :rules="rules" label-width="160px">
            <el-card>
              <el-row class="basic">
                <el-col :span="24">
                  <span class="traing"></span>运动员基本信息
                  <span class="traing"></span>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="10">
                  <el-form-item label="运动员名称" class="trianing" prop="name">
                    <el-input v-model="form.name"></el-input>
                  </el-form-item>                  
                  <el-form-item label="运动员出生日期" prop="birthday" >
                    <el-date-picker v-model="form.birthday" type="date" placeholder="选择日期"></el-date-picker>
                  </el-form-item>
                  <el-form-item label="运动员技术等级" prop="level">
                    <el-select v-model="formInline.level" placeholder>
                      <el-option label="国际级运动健将" value></el-option>
                      <el-option label="运动健将" value="女"></el-option>
                      <el-option label="一级运动员" value="女"></el-option>
                      <el-option label="二级运动员" value="女"></el-option>
                      <el-option label="三级运动员" value="女"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="技术等级授予单位" prop="deptid">
                    <el-input v-model="form.deptid"></el-input>
                  </el-form-item>
                  <el-form-item label="运动员学历" prop="education">
                    <el-select v-model="formInline.education" placeholder="学历">
                      <el-option label="博士" value></el-option>
                      <el-option label="硕士" value="1"></el-option>
                      <el-option label="本科" value="2"></el-option>
                      <el-option label="专科" value="3"></el-option>
                      <el-option label="高中" value="4"></el-option>
                      <el-option label="初中" value="5"></el-option>
                      <el-option label="小学" value="6"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="上传伤病报告" prop="imgUrl">
                    <el-upload
                      action="https://jsonplaceholder.typicode.com/posts/"
                      list-type="picture-card"
                      v-model="form.imgUrl"
                    >
                      <!-- :on-preview="handlePictureCardPreview"
                      :on-remove="handleRemove"-->

                      <i class="el-icon-plus"></i>
                    </el-upload>
                    <!-- <el-dialog :visible.sync="dialogVisible">
            :src="dialogImageUrl"
            <img width="100%" alt />
                    </el-dialog>-->
                  </el-form-item>
                </el-col>
                <el-col :span="12" align="left">
                  <!-- class="trianing-sex" -->
                  <el-form-item label="运动员性别" prop="sex">
                    <el-select v-model="form.sex" placeholder="性别">
                      <el-option label="男" value="0"></el-option>
                      <el-option label="女" value="1"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="运动员梯队" prop="echelon">
                    <el-select v-model="form.echelon" placeholder="梯队选择">
                      <el-option label="一队" value="一队"></el-option>
                      <el-option label="二队" value="1"></el-option>
                      <el-option label="三队" value="2"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="证书编号" prop="certificateNumber">
                    <el-input v-model="form.certificateNumber" maxlength="30"></el-input>
                  </el-form-item>
                  <el-form-item label="运动员训练年限" class="trianing-time" prop="trainingTime">
                    <el-date-picker v-model="form.trainingTime" type="date" placeholder="选择日期"></el-date-picker>
                  </el-form-item>
                  <el-form-item label="输送单位" prop="conveyingUnit">
                    <el-input v-model="form.conveyingUnit"></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-card>
            <el-card>
              <el-row class="basic">
                <el-col :span="24">
                  <span class="traing"></span>运动员状态设置
                  <span class="traing"></span>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="该名运动员状态选择" prop="status">
                    <el-select v-model="form.status" placeholder="状态筛选" >
                      <el-option label="训练中" value="0"></el-option>
                      <el-option label="外训中" value="2"></el-option>
                      <el-option label="请假中" value="3"></el-option>
                      <el-option label="生病中" value="4"></el-option>
                      <el-option label="受伤中" value="5"></el-option>
                      <el-option label="离队" value="1"></el-option>
                      <el-option label="过敏" value="6"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12" v-if="form.status=='2'">
                  <el-form-item label="归队时间" class="trianing-age" prop="returnTime">
                    <el-date-picker v-model="form.returnTime" type="date" placeholder="选择日期"></el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="12" v-if="form.status=='3'">
                  <el-form-item label="归队时间" class="trianing-age" prop="returnTime">
                    <el-date-picker v-model="form.returnTime" type="date" placeholder="选择日期"></el-date-picker>
                  </el-form-item>
                </el-col>
              </el-row>

              <el-form-item label="编辑原因" v-if="form.status!=='0'" prop="returnReason">
                <el-input
                  type="textarea"
                  :rows="8"
                  placeholder="请输入内容"
                  v-model="form.returnReason"
                  class="textarea"
                ></el-input>
              </el-form-item>
            </el-card>
            <el-card class="stauts">
              <el-row class="basic">
                <el-col :span="24">
                  <span class="traing"></span>运动员身体形态
                  <span class="traing"></span>
                </el-col>
              </el-row>
              <el-col :span="8">
                <el-form-item label="身高" prop="height" label-width="137px">
                  <el-input type="input" v-model="form.height" placeholder="（厘米）"></el-input>
                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="坐高" prop="sitHigh" label-width="137px">
                  <el-input type="input" v-model="form.sitHigh" placeholder="（米）"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="臀展" label-width="137px" prop="armSpread">
                  <el-input
                    type="input"
                    v-model="form.armSpread"
                    placeholder="（米）"
                    prop="HipExhibition"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="腰围" label-width="137px" prop="waistline">
                  <el-input type="input" v-model="form.waistline" placeholder="（厘米）"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="臀围" label-width="137px" prop="hipline">
                  <el-input type="input" v-model="form.hipline" placeholder="（厘米）"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="小腿长" label-width="137px" prop="tinyLegLength">
                  <el-input type="input" v-model="form.tinyLegLength" placeholder="（米）"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="腿长" label-width="137px" prop="legLength">
                  <el-input type="input" v-model="form.legLength" placeholder="（米）"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="胸围" label-width="137px" prop="bust">
                  <el-input type="input" v-model="form.bust" placeholder="（厘米）"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="肩宽" label-width="137px" prop="shoulderWidth">
                  <el-input type="input" v-model="form.shoulderWidth" placeholder="（厘米）"></el-input>
                </el-form-item>
              </el-col>
            </el-card>
            <el-row style="text-align: center;margin-top:20px;">
              <el-button type="primary" class="button2" @click="submitForm">{{row?'保存':'修改'}}</el-button>
            </el-row>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="陆上力量" name="second" class="lushang">
          <el-col :span="24" class="bigstring">
            <span class="traing"></span>运动员基本身体素质(最大力量)
            <span class="traing"></span>
          </el-col>

          <el-form
            :inline="true"
            ref="formtable"
            :model="formtable"
            :rules="ruleslight"
            label-width="180px"
          >
            <div>
              <el-card>
                <el-col :span="12">
                  <el-form-item label="卧推" prop="verticalJump">
                    <el-input type="input" v-model="formtable.benchPress" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="卧推理想值" prop="verticalJumpIdeal">
                    <el-input type="input" v-model="formtable.benchPressIdeal" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="硬拉" prop="anteflexion">
                    <el-input type="input" v-model="formtable.hardPull" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="硬拉理想值" prop="anteflexionIdeal">
                    <el-input type="input" v-model="formtable.hardPullIdeal" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="卧拉" prop="run30m">
                    <el-input type="input" v-model="formtable.wola" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="卧拉理想值" prop="run30mIdeal">
                    <el-input type="input" v-model="formtable.wolaIdeal" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="高翻" prop="run3000m">
                    <el-input type="input" v-model="formtable.highTurnover" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="高翻理想值" prop="run3000mIdeal">
                    <el-input type="input" v-model="formtable.highTurnoverIdeal" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="深蹲" prop="threeStepJump">
                    <el-input type="input" v-model="formtable.squat" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="深蹲理想值" prop="threeStepJumpIdeal">
                    <el-input type="input" v-model="formtable.squatIdeal" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="体重" prop="weight">
                    <el-input type="input" v-model="formtable.weight" placeholder="（公斤）"></el-input>
                  </el-form-item>
                </el-col>
              </el-card>
            </div>
            <!-- 加样式的问题 -->
            <el-card style="margin-top:20px;">
              <div class="stauts">
                <el-col :span="24" class="bigstring">
                  <span class="traing"></span>运动员基本身体素质(力量耐力)
                  <span class="traing"></span>
                </el-col>
                <el-form-item label="3min卧推(25公斤)" prop="benchPress25kg3m">
                  <el-input type="input" v-model="formtable.benchPress25kg3m" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="3min卧推理想值(25公斤)" label-width="302px" prop="benchPress25kg3mIdeal">
                  <el-input
                    type="input"
                    v-model="formtable.benchPress25kg3mIdeal"
                    placeholder="（次）"
                  ></el-input>
                </el-form-item>
                <el-form-item label="3min卧拉(30公斤)" prop="wola30kg3m">
                  <el-input type="input" v-model="formtable.wola30kg3m" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="3mIn卧拉理想值(30公斤)" label-width="302px" prop="wola30kg3mIdeal">
                  <el-input type="input" v-model="formtable.wola30kg3mIdeal" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="3min收腹" prop="pullStomachs3m">
                  <el-input type="input" v-model="formtable.pullStomachs3m" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="3min收腹理想值" label-width="302px" prop="pullStomachs3mIdeal">
                  <el-input type="input" v-model="formtable.pullStomachs3mIdeal" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="3min深蹲" prop="squat40kg3m">
                  <el-input type="input" v-model="formtable.squat40kg3m" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="3min深蹲理想值(40公斤)" label-width="302px" prop="squat40kg3mIdeal" >
                  <el-input type="input" v-model="formtable.squat40kg3mIdeal" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="腹肌耐力" prop="abdominalEndurance" >
                  <el-input type="input" v-model="formtable.abdominalEndurance" placeholder="（次）"></el-input>
                </el-form-item>
                <el-form-item label="腹肌耐力理想值" label-width="302px" prop="abdominalEnduranceIdeal">
                  <el-input
                    type="input"
                    v-model="formtable.abdominalEnduranceIdeal"
                    placeholder="（次）"
                  ></el-input>
                </el-form-item>
                <el-form-item label="引体向上最大次数" prop="pullUp">
                  <el-input type="input" v-model="formtable.pullUp" placeholder="（次）"></el-input>
                </el-form-item>

                <el-form-item label="引体向上最大次数理想值" label-width="302px" prop="pullUpIdeal">
                  <el-input type="input" v-model="formtable.pullUpIdeal" placeholder="（次）"></el-input>
                </el-form-item>

                <el-form-item label="静力高架背肌" prop="staticElevatedDorsalMuscle">
                  <el-input
                    type="input"
                    v-model="formtable.staticElevatedDorsalMuscle"
                    placeholder="（秒）"
                  ></el-input>
                </el-form-item>

                <el-form-item label="静力高架背肌理想值" label-width="302px" prop="staticElevatedDorsalMuscleIdeal">
                  <el-input
                    type="input"
                    v-model="formtable.staticElevatedDorsalMuscleIdeal"
                    placeholder="（秒）"
                  ></el-input>
                </el-form-item>

                <el-form-item label="背肌耐力" prop="backMuscleEndurance">
                  <el-input type="input" v-model="formtable.backMuscleEndurance" placeholder="（次）"></el-input>
                </el-form-item>

                <el-form-item label="背肌耐力理想值" label-width="302px" prop="anteflexionIdeal">
                  <el-input type="input" v-model="formtable.anteflexionIdeal" placeholder="（次）"></el-input>
                </el-form-item>
              </div>
            </el-card>
            <div class="stauts">
              <el-card>
                <el-col :span="24" class="bigstring">
                  <span class="traing"></span>运动员基本身体素质
                  <span class="traing"></span>
                </el-col>
                <el-form-item label="垂直纵跳" prop="verticalJump">
                  <el-input type="input" v-model="formtable.verticalJump" placeholder="（米）"></el-input>
                </el-form-item>
                <el-form-item label="垂直纵跳理想值" label-width="302px" prop="verticalJumpIdeal">
                  <el-input type="input" v-model="formtable.verticalJumpIdeal" placeholder="（米）"></el-input>
                </el-form-item>
                <el-form-item label="坐位体前屈" prop="anteflexion">
                  <el-input type="input" v-model="formtable.anteflexion" placeholder="（厘米）"></el-input>
                </el-form-item>
                <el-form-item label="坐位体前屈理想值" label-width="302px" prop="anteflexionIdeal">
                  <el-input type="input" v-model="formtable.anteflexionIdeal" placeholder="（厘米）"></el-input>
                </el-form-item>
                <el-form-item label="30米跑" prop="run30m">
                  <el-input type="input" v-model="formtable.run30m" placeholder="（秒）"></el-input>
                </el-form-item>
                <el-form-item label="30米跑理想值" label-width="302px" prop="run30mIdeal" >
                  <el-input type="input" v-model="formtable.run30mIdeal" placeholder="（秒）"></el-input>
                </el-form-item>

                <el-form-item label="3000米跑" prop="run3000m">
                  <el-input type="input" v-model="formtable.run3000m" placeholder="（秒）"></el-input>
                </el-form-item>
                <el-form-item label="3000米跑理想值" label-width="302px" prop="run3000mIdeal">
                  <el-input type="input" v-model="formtable.run3000mIdeal" placeholder="（秒）"></el-input>
                </el-form-item>

                <el-form-item label="三级跳远" prop="threeStepJump">
                  <el-input type="input" v-model="formtable.threeStepJump" placeholder="（米）"></el-input>
                </el-form-item>
                <el-form-item label="三级跳远理想值" label-width="302px" prop="threeStepJumpIdeal">
                  <el-input type="input" v-model="formtable.threeStepJumpIdeal" placeholder="（米）"></el-input>
                </el-form-item>
              </el-card>
            </div>
          </el-form>
          <el-row style="text-align: center;margin-top:20px;">
            <el-button
              type="primary"
              class="button2"
              id="buttonadd"
              @click="submitForm"
            >{{row?"保存":"修改"}}</el-button>
          </el-row>
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>
<script>
import {
  addUser1,
  addPhysical2,
  updateUser1,
  updatePhysical2,
} from "@/api/monitor/logininfor";
import { validateCode, validate } from "@/utils/reg";
export default {
  name: "Popup.vue",
  props: ["rowData"],
  data() {
    return {
      activeName: "first",
      msg: "我是子组件的msg",
      row: true, //编辑数据
      // 表单
      formInline: {
        user: "",
        region: "",
      },
      form: this.initForm(),
      formtable: this.twoForm(),

      rules: {
        name: [
          {  pattern: /^[\u4e00-\u9fa5]+$/,required: true, message: "请输入正确的用户名", trigger: "blur" },
        ],
        birthday: [
          { required: true, message: "出生日期不能为空", trigger: "blur" },
        ],
        echelon: [
          { required: true, message: "用户梯队不能为空", trigger: "change" },
        ],
        sex: [{ required: true, message: "性别不能为空", trigger: "change" }],
        certificateNumber: [{ validator: validateCode, trigger: "blur" }],
        height: [
          {
            pattern: /^\d{1,3}\.\d{0,2}$/,
            trigger: "blur",
            message: "请输入正确的数字",
          },
        ],
        sitHigh: [
          {
            pattern: /^\d{1,3}\.\d{0,2}$/,
            trigger: "blur",
            message: "请输入正确的数字",
          },
        ],
        armSpread: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
        waistline: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
        hipline: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
        HipExhibition: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
        tinyLegLength: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
        legLength: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
        bust: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
        shoulderWidth: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur", message: "请输入正确的数字" }],
      },
      ruleslight: {
        verticalJump: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        verticalJumpIdeal: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        anteflexionL: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        anteflexionIdeal: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        run30m: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        run30mIdeal: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        run3000m: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        run3000mIdeal: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        threeStepJump: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
        threeStepJumpIdeal: [
          { pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" },
        ],
        weight: [{ pattern: /^\d{1,3}\.\d{0,2}$/, trigger: "blur" }],
      },
      type: "",
    };
  },
  mounted(){
    this.setEdit(this.rowData);
  },
  watch:{
    "rowData":function(){
      console.log(this.rowData);
      this.setEdit(this.rowData);
    }
  },
  // 提交按钮
  methods: {
    setEdit(row) {
       this.form = row?JSON.parse(JSON.stringify(row)):this.initForm();
    },
    initForm() {
      return {
        age: "",
        armSpread: "",
        birthday: "",
        bust: "",
        certificateNumber: "",
        conveyingUnit: "",
        ctime: "",
        deptid: "",
        echelon: "",
        education: "",
        height: "",
        hipline: "",
        id: "",
        imgUrl: "",
        legLength: "",
        level: "",
        ltime: "",
        name: "",
        ratingUnit: "",
        sex: "",
        shoulderWidth: "",
        sitHigh: "",
        status: "",
        tinyLegLength: "",
        trainingTime: "",
      };
    },
    twoForm() {
      return {
        abdominalEndurance: "",
        abdominalEnduranceIdeal: "",
        anteflexion: "",
        anteflexionIdeal: "",
        backMuscleEndurance: "",
        backMuscleEnduranceIdeal: "",
        benchPress: "",
        benchPress25kg3m: "",
        benchPress25kg3mIdeal: "",
        benchPressIdeal: "",
        hardPull: "",
        hardPullIdeal: "",
        highTurnover: "",
        highTurnoverIdeal: "",
        id: "",
        sportsman_id: "",
        pullStomachs3m: "",
        pullStomachs3mIdeal: "",
        pullUp: "",
        pullUpIdeal: "",
        run3000m: "",
        run3000mIdeal: "",
        run30m: "",
        run30mIdeal: "",
        sportsmanId: "",
        sportsmanName: "",
        squat: "",
        squat40kg3m: "",
        squat40kg3mIdeal: "",
        squatIdeal: "",
        staticElevatedDorsalMuscle: "",
        staticElevatedDorsalMuscleIdeal: "",
        threeStepJump: "",
        threeStepJumpIdeal: "",
        verticalJump: "",
        verticalJumpIdeal: "",
        weight: "",
        wola: "",
        wola30kg3m: "",
        wola30kg3mIdeal: "",
        wolaIdeal: "",
      };
    },
    submitForm() {
      let arr = [];
      this.$refs.firstForm.validate((valid) => {
        if (valid) {
          arr.push(valid);
        } 
      });
      this.$refs.firstForm.validate((valid) => {
        if (valid) {
          arr.push(valid);
        } 
      });
     
      if (arr.length == 2) {
        if (this.rowData) {
          Promise.all([
            updateUser1({ sportsman: this.form }),
            updatePhysical2({
              sportsmanPhysicalQuality: {
                ...this.formtable,
                id: this.rowData.id,
              },
            }),
          ])
            .then((res) => {             
              let flag = false;
              if (res[0].code == 200) {
                flag = true;
                this.$emit("getMsgFormSon", this.msg);
              } else {
                flag = false;
                // this.msgError(res.msg);
              }
              if (res[1].code == 200) {
                flag = true;
              } else {
                flag = false;
                // this.msgError(res.msg);
              }
              if (flag) {
                this.msgSuccess("修改成功");
                this.$emit("getMsgFormSon", this.msg);
              }
            })
            .catch((err) => {
              this.$emit("getMsgFormSon", this.msg);
            });
        } else {
           this.$nextTick(() => {             
                    this.$refs.firstForm.clearValidate();
                    this.$refs.firstForm.resetFields();
                    this.$refs.formtable.clearValidate();
                    this.$refs.formtable.resetFields();                 
                  });                
          addUser1(this.form).then((res) => {
            if (res.code === 200) {
              this.formtable.sportsmanId = res.data.id;
              addPhysical2(this.formtable).then((res) => {
                if (res.code === 200) {
                  this.msgSuccess("新增成功");
                  this.$emit("getMsgFormSon", this.msg);
                 
                } else {
                  this.msgError(res.msg);
                }
              });
              
            } else {
              this.msgError(res.msg);
            }            
          });
        }
      }
    },
 
  },
};
</script>
<style scoped>
.traing {
  display: inline-block;
  width: 14px;
  height: 8px;
  background-color: #2583ff;
  margin-right: 7px;
  margin-left: 7px;
}
.basic {
  margin-bottom: 20px;
  text-align: left;
}
.stauts {
  margin-top: 20px;
}
.el-row .button1 {
  margin-left: -63px;
}
.el-row .button2 {
  margin-left: 46px;
}
</style>
<style>
.name-vulue .el-input__inner {
  text-align: right;
}
.lushang .el-input__inner {
  text-align: right;
}
.stauts .el-input--medium .el-input__inner {
  text-align: right;
}
.bigstring {
  margin: 20px;
}
</style>